package io.renren.modules.student.controller;


import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;
import io.renren.modules.student.dao.TeachPlanDao;
import io.renren.modules.student.entity.TeachPlanEntity;
import io.renren.modules.student.service.TeachPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("teachPlan")
public class TeachPlanController {

    @Autowired
    TeachPlanService teachPlanService;

    /**
     * 列表
     */
    @RequestMapping("/getListBySchoolId")
    //@RequiresPermissions("course:student:list")
    public R list(Integer id){
        PageUtils page = teachPlanService.getListBySchoolId(id);
        System.out.println(page);
            return R.ok().put("page", page);
    }

    /**
     * 列表
     */
    @RequestMapping("/delete")
    //@RequiresPermissions("course:student:list")
    public R delete(Integer id){
       teachPlanService.delete(id);
        return R.ok("删除成功",0);
    }

    /**
     * 列表
     */
    @RequestMapping("/save")
    //@RequiresPermissions("course:student:list")
    public R save(@RequestBody TeachPlanEntity teachPlanEntity){
        teachPlanService.save(teachPlanEntity);
        return R.ok("保存成功",0);
    }


}
